<?php

//PLUGIN type=action
//PLUGIN name=library.file.move
//PLUGIN desc=Enables you to move files in the library
//PLUGIN group=native



    if (!empty($options['file']) && !empty($options['to']))
    {
        $file = explode("/", $options['file']);
        $file = $file[count($file) - 1];

        if ($options['to'] == "1")
            $options['to'] = "";

        if (move(_LIBRARYPATH_ . "/images" . $options['file'], _LIBRARYPATH_ . "/images" . $options['to'] . "/" . $file, true))
            print "OK";
        else
            print "FAILURE";
    }else
    {
        print "FAILURE";
    }


exit();
?>